package com.zzyl.nursing.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzyl.nursing.domain.NursingProjectPlan;
import com.zzyl.nursing.dto.NursingProjectPlanDto;
import com.zzyl.nursing.vo.NursingProjectPlanVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 护理计划和项目关联Mapper接口
 */
@Mapper
public interface NursingProjectPlanMapper extends BaseMapper<NursingProjectPlan> {

    //根据护理计划ID查询护理计划和护理项目的关系
    List<NursingProjectPlanVo> selectByPlanId(Long planId);

    //批量插入护理项目计划关系
    int batchInsert(@Param("list") List<NursingProjectPlanDto> projectPlans, @Param("planId") Long planId);

    @Delete("delete from nursing_project_plan where plan_id = #{planId}")
    void deleteByPlanId(Long planId);
}